/**
 * 高值耗材采购模块，提供医疗服务编辑页面初始化组件功能
 * 
 * @Date: 2016-1-25
 * @author: Jackson wang
 * @version: 1.0
 * @since: 1.0
 */

define(	["jquery", "sysmanMain", "msgServ", "flowInit", "datagridServ",
				"deptSelect", "panelUtil", "uploadfiles","deptUserSelect"], function($,
				sysmanMain, msgServ, flowInit, datagridServ, deptSelect,
				panelUtil, uploadfiles,deptUserSelect) {

			'use strict';
			var _typeUrl = '/dictionary/getTree.action', 
			_rootpath, 
			el_width = 300, 
			el_big_width = 670, 
			window_width = 900, 
			window_height = 700, 
			rootid = 'panel-oa-logisticspurchase', 
			window_id = 'oa-logisticspurchase-win', 			
			editIndex
			,
			
			//业务编码
			_bizcode = 'oaLogisticsPurchase',
			//脚本传入参数
			scriptParam

			var public_method = {
				
				/**
				 * 脚本弹出编辑页面
				 * @param _options.id	业务id
				 */
				openEditPage:function(_options){
					var _default = {
						
						id:null,
						bizcode:_bizcode,
						url:'/'+_default.bizcode +'/editPage.action'
					}
				}
				,

				/**
				 * 初始化新增页面
				 * 
				 * @param _options.record
				 *            列表选中行
				 * @param _options.form
				 *            页面form对象
				 * @param _options.rootid
				 *            页面根节点id
				 * @param _options.flowStateSelector
				 *            流程状态字段选择器
				 */
				initEdit : function(_options) {

					var queryUrlP = '/'
							+ sysmanMain.getRootPath()
							+ '/oaLogisticsPurchaseSubPurchase/getListDomain.action';
					var queryUrlE = '/'
							+ sysmanMain.getRootPath()
							+ '/oaLogisticsPurchaseSubExist/getListDomain.action';
					var queryUrl = '';

					var gridParamP = {
						height : 100,
						onClickCell : private_method.editPurchaseCell,
						columns : [[{
									field : 'ck',
									checkbox : "true"
								}, {
									field : 'product_name',
									title : '产品名称',
									align : 'center',
									halign : 'center',
									width : 40,
									editor : 'text'
								}, {
									field : 'product_info',
									title : '规格型号或参数，要求，数量',
									width : 80,
									align : 'center',
									halign : 'center',
									editor : 'text'
								}, {
									field : 'product_purchase',
									title : '预算金额',
									width : 40,
									align : 'center',
									halign : 'center',
									editor : 'text'
								}]],
						rownumbers : true,
						animate : true,
						striped : true,
						border : true,
						idField : 'id',
						fitColumns : true,
						toolbar : '#' + window_id
								+ ' #inner-table-logisticspurchase_fst'
					}

					var gridParamE = {
						height : 100,
						onClickCell : private_method.editExistCell,
						columns : [[{
									field : 'ck',
									checkbox : "true"
								}, {
									field : 'old_product_brand',
									title : '品牌',
									align : 'center',
									halign : 'center',
									width : 60,
									editor : 'text'
								}, {
									field : 'old_product_info',
									title : '规格型号',
									width : 60,
									align : 'center',
									halign : 'center',
									editor : 'text'
								}, {
									field : 'old_product_running_state',
									title : '使用状况',
									width : 60,
									align : 'center',
									halign : 'center',
									editor : 'text'
								}, {
									field : 'old_product_amount',
									title : '数量',
									width : 60,
									align : 'center',
									halign : 'center',
									editor : 'text'
								}]],
						rownumbers : true,
						animate : true,
						striped : true,
						singleSelect : true,
						border : true,
						idField : 'id',
						fitColumns : true,
						toolbar : '#' + window_id
								+ ' #inner-table-logisticspurchase_sec'
					}
					if (_options && _options.record && _options.record.id) {
						gridParamP.url = queryUrlP;
						gridParamP.queryParams = {
							mainId : _options.record.id
						};

						gridParamE.url = queryUrlE;
						gridParamE.queryParams = {
							mainId : _options.record.id
						};
					}

					private_method.initFileList();

					var _elP = $('#' + window_id
							+ ' #dg-inner-logisticspurchase_fst');
					var _elE = $('#' + window_id
							+ ' #dg-inner-logisticspurchase_sec');

					if (_elP.length > -1) {
						_elP.datagrid(gridParamP);
					}
					if (_elE.length > -1) {
						_elE.datagrid(gridParamE);
					}
					/*
					 * if(_el.length==1){ _el.datagrid({ url : queryUrl, height :
					 * 100, onClickCell:private_method.editCell, columns:[[
					 * {field:'ck',checkbox:"true"},
					 * {field:'product_name',title:'产品名称',halign:'center',width:30,editor:'text'},
					 * {field:'product_info',title:'规格型号或参数，要求，数量',width:100,align:'center',halign:'center',editor:'text'},
					 * {field:'product_purchase',title:'预算金额',width:30,align:'center',halign:'center',editor:'text'},
					 * ]], rownumbers:true, animate: true, striped:true,
					 * border:true, idField: 'id', fitColumns: true,
					 * toolbar:'#'+ window_id + '
					 * #inner-table-logisticspurchase_fst' }) } $('#' +
					 * window_id + '
					 * #dg-inner-logisticspurchase_sec').datagrid({ url :
					 * queryUrl, height : 100,
					 * onClickCell:private_method.editCell, columns:[[
					 * {field:'ck',checkbox:"true"},
					 * {field:'old_product_brand',title:'品牌',halign:'center',width:30,editor:'text'},
					 * {field:'old_product_info',title:'规格型号',width:100,align:'center',halign:'center',editor:'text'},
					 * {field:'old_product_running_state',title:'运行状况',width:100,align:'center',halign:'center',editor:'text'},
					 * {field:'old_product_amount',title:'数量',width:30,align:'center',halign:'center',editor:'text'},
					 * ]], rownumbers:true, animate: true, striped:true,
					 * singleSelect:true, border:true, idField: 'id',
					 * fitColumns: true, toolbar:'#' + window_id + '
					 * #inner-table-logisticspurchase_sec' })
					 */
				},
				closeWindow : function() {
					$('#' + rootid + ' a.inner-table-btn').unbind('click');
					$('#' + window_id).empty()
					var _moduleConfig = sysmanMain.getCurrentModuConfig();
					_moduleConfig.initParam = {
						editable : true
					};
					sysmanMain.setCurrentModuConfig(_moduleConfig);
				},
				/**
				 * @param _options.rootid
				 * @param _options.conditionSelector
				 * @param _options.
				 */
				initList : function(_options) {
					private_method.initCondition(_options)
				},
				/**
				 * @param _options.record
				 */
				buttonExtends : function() {
					var logisticspurchase_inner_table_fst = $('#'
							+ window_id
							+ ' #dg-inner-logisticspurchase_fst')
					var logisticspurchase_inner_table_sec = $('#'
							+ window_id
							+ ' #dg-inner-logisticspurchase_sec')
					return {
						'耗材清单' : private_method.detailInfo,
						'附件' : function() {
							private_method.uploadInit()
						},
						'返回' : function() {
							console.info("I've got the return button!!!")
							private_method.changePanel({
										classType : 'edit-panel'
									})
							private_method.initFileList();
						},
						'上传' : function() {
							console.info("I've got the upload button!!!")
							private_method.upload()
						},
						'删除' : function() {
							console.info("I've got the upload button!!!")
							private_method.delFile()
						},
						'流程图' : function() {
							private_method.changePanel({
										classType : 'historicalDiagram-panel'
									})
						},
						'流程节点' : function() {
							private_method.changePanel({
										classType : 'historical-panel'
									})
						},
						'新购设备新增' : function() {
							$(logisticspurchase_inner_table_fst).datagrid(
									'appendRow', {})
						},
						'现有设备新增' : function() {
							$(logisticspurchase_inner_table_sec).datagrid(
									'appendRow', {})
						},
						'新购设备删除' : function() {
							var record = $(logisticspurchase_inner_table_fst)
									.datagrid('getSelected');
							if (record) {
								var rowindex = $(logisticspurchase_inner_table_fst)
										.datagrid('getRowIndex', record);

								$(logisticspurchase_inner_table_fst).datagrid(
										'deleteRow', rowindex);
							} else {
								msgServ.Msgslide('请选择删除的记录');
							}
						},
						'现有设备删除' : function() {
							var record = $(logisticspurchase_inner_table_sec)
									.datagrid('getSelected');
							if (record) {
								var rowindex = $(logisticspurchase_inner_table_sec)
										.datagrid('getRowIndex', record);

								$(logisticspurchase_inner_table_sec).datagrid(
										'deleteRow', rowindex);
							} else {
								msgServ.Msgslide('请选择删除的记录');
							}
						}
					}
				},

				reCreateField : function(_options) {
					private_method.reCreateField(_options)
				},
				rowDblClick : function(index, row) {
					private_method.rowDblClick(index, row)
				},
				beforeSubmit : function() {
					var _elP = $('#' + window_id
							+ ' #dg-inner-logisticspurchase_fst')
					var subP, subE, ret = {}
					if (_elP.length > -1) {
						if (editIndex > -1) {
							_elP.datagrid('acceptChanges');
							_elP.datagrid('endEdit', editIndex);
						}
						var rowsP = _elP.datagrid('getData')
						if (rowsP && rowsP.rows) {
							ret.purchase_object = $.toJSON(rowsP.rows)
						}
					}
					var _elE = $('#' + window_id
							+ ' #dg-inner-logisticspurchase_sec')
					if (_elE.length > -1) {
						if (editIndex > -1) {
							_elE.datagrid('acceptChanges');
							_elE.datagrid('endEdit', editIndex);
						}
						var rowsE = _elE.datagrid('getData')
						if (rowsE && rowsE.rows) {
							ret.exist_object = $.toJSON(rowsE.rows)
						}
					}
					return ret;
				}
			}

			var private_method = {
				editPurchaseCell : function(index, field, value) {
					if (window.console) {
						console.info("Hello everyone I'm PurchaseCell!");
					}
					var logisticspurchase_inner_table_fst = $('#'
							+ window_id
							+ ' #dg-inner-logisticspurchase_fst');
					if (editIndex > -1 && editIndex != index) {
						$(logisticspurchase_inner_table_fst)
								.datagrid('acceptChanges');
						$(logisticspurchase_inner_table_fst).datagrid(
								'endEdit', editIndex);
					}

					$(logisticspurchase_inner_table_fst).datagrid('beginEdit',
							index);
					editIndex = index
				},
				editExistCell : function(index, field, value) {
					if (window.console) {
						console.info("Hello everyone I'm PurchaseCell!");
					}
					var logisticspurchase_inner_table_sec = $('#'
							+ window_id
							+ ' #dg-inner-logisticspurchase_sec');
					if (editIndex > -1 && editIndex != index) {
						$(logisticspurchase_inner_table_sec)
								.datagrid('acceptChanges');
						$(logisticspurchase_inner_table_sec).datagrid(
								'endEdit', editIndex);
					}

					$(logisticspurchase_inner_table_sec).datagrid('beginEdit',
							index);
					editIndex = index
				},
				editCell : function(index, field, value) {
					if (window.console)
						console.info(' editCell fired ...')
					var logisticspurchase_inner_table = $('#' + window_id
							+ ' #dg-inner-logisticspurchase')
					if (editIndex > -1 && (editIndex != index)) {
						$(logisticspurchase_inner_table)
								.datagrid('acceptChanges');
						$(logisticspurchase_inner_table).datagrid('endEdit',
								editIndex);
					}

					$(logisticspurchase_inner_table).datagrid('beginEdit',
							index);
					editIndex = index
				},

				initFileList : function() {
					var el = $('#' + window_id
							+ ' form.main-form div.fileList')
					var _idEl = $('#' + window_id + ' form.main-form #id')
					var uploadListurl = '/upload/query/getInitListDomain.action'
					
					if (!_idEl.val()) {
						return;
					}
					var parm = {
						condition : {
							bizno : _idEl.val(),
							bizcode : _bizcode
						}
					}
					$.ajax({
								url : '/' + sysmanMain.getRootPath()
										+ uploadListurl,
								type : 'post',
								async : false,
								data : parm,
								success : function(result) {
									var _aParam = {
										target : el,
										data : result
									}

									private_method.appendList(_aParam)
								},
								failure : function(result) {
									if (window.console) {
										console.log('ajax call failured ...')
									}
								}
							})
				},
				appendList : function(_options) {
					if (_options.target && _options.data) {
						$(_options.target).empty();
						var _html = '点击名字下载';
						$.each(_options.data.rows, function(i, e) {
							console.info("got one");
							_html += '<span style = "cursor:pointer" onmouseover="font color="#0000FF"" onmouseout="font color="#FFFFFF"" class = "'
									+ 'fileDownBut'
									+ '"'
									+ 'fileId = "'
									+ e.id
									+ '">' + e.filename + '</span>';
						})
						// private_method.changeStyle()
						$(_options.target).append(_html)
						$(".fileDownBut").unbind('click')
						$(".fileDownBut").bind('click',
								private_method.fileDownload)

					}
				},
				changeStyle : function() {
					$(".fileDownBut").live({
								mouseover : function() {
									$(this).css("font-color", "blue");
								},
								mouseout : function() {
									$(this).css("font-color", "black");
								}
							})
				},

				fileDownload : function(e) {
					if (e) {
						var tpObj = e.currentTarget
						private_method.downloadfile($(tpObj).attr('fileId'));
					}
				},
				downloadfile : function(id) {
					if (window.console) {
						console.log('download file fired ')
					}
					var _url = '/' + sysmanMain.getRootPath()
							+ '/upload/downloadFileTest.action'
					var form = $("<form>");
					form.attr('style', 'display:none');
					form.attr('target', '');
					form.attr('method', 'post');
					form.attr('action', _url);
					var input1 = $("<input>");
					input1.attr('type', 'hidden')
					input1.attr('name', 'id')
					input1.attr('value', id);
					$('body').append(form);
					$(form).append(input1);

					form.submit();
					form.remove();

				},
				uploadInit : function() {
					var _moduleConfig = sysmanMain.getCurrentModuConfig();

					var $edit_window = $('#' + window_id);
					var isSaved = false, _id
					var _idEl = $('#' + window_id + ' form.main-form #id')
					if (_idEl.length == 1) {
						_id = $(_idEl).val()
						if (_id) {
							isSaved = true
						}
					}

					if (!isSaved) {
						msgServ.Msgslide('保存后才能上传附件');
						return
					}
					this.uploadInitList({
								_moduleConfig : _moduleConfig
							});
					private_method.changePanel({
								classType : 'upload-panel'
							})
					if (_moduleConfig.bizcode && _id) {
						this.uploadInitRel({
									_moduleConfig : _moduleConfig
								});
					}
				},

				upload : function() {
					uploadfiles.upload()
				},
				delFile : function() {
					uploadfiles.del({
								biztableid : window_id
										+ ' div.table-archive',
								rootPath : '/' + sysmanMain.getRootPath()
							})
				},
				uploadInitList : function(_options) {
					var _idEl = $('#' + window_id + ' form.main-form #id')
					uploadfiles.initList({
						data : {
							bizno : _idEl.val(),
							bizcode : _bizcode
						},
						rootPath : '/' + sysmanMain.getRootPath(),
						biztableid : window_id
								+ ' div.upload-panel div.table-archive',
						toolbarid : window_id
								+ ' div.upload-panel div.archive-btn a.file_upload_btn'

					})
				},

				uploadInitRel : function(_options) {
					var _idEl = $('#' + window_id + ' form.main-form #id')
					uploadfiles.init({
						data : {
							bizno : _idEl.val(),
							bizcode : _bizcode
						},
						queue_id : window_id
								+ ' div.upload-panel form.upload-form #queue',
						file_id : window_id
								+ ' div.upload-panel form.upload-form #file_upload',
						rootPath : '/' + sysmanMain.getRootPath(),
						rootid : window_id

					})
				},

				changePanel : function(_options) {
					var _moduleConfig = sysmanMain.getCurrentModuConfig();
					var tep = $('#' + window_id + ' div.toggle-panel')
					console.info("run, saw?")
					tep.panel('close')
					if (tep.length > 0) {
						tep.panel('close')
						console.info("here all closed")
					}

					// var hd =
					// if(_options && _options.length > 0 && _options.classType
					// && _options.classType.length > 0){
					tep = $('#' + window_id + '  div.'
							+ _options.classType)
					tep.panel('open')
					console.info("here " + _options.classType + " closed")
					// }
				},
				rowDblClick : function(index, row) {

					var editWindow = 'oa-logisticspurchase-win';
					// var editWindow = 'medical-recipel-win';
					var _param = {}
					var _moduleConfig = sysmanMain.getCurrentModuConfig();
					if (!_moduleConfig) {
						_moduleConfig = {}
					}

					var flow_state_el = $('#' + window_id
							+ ' form.condition-form #flow_state')
					var flow_state_value = $(flow_state_el)
							.combobox('getValue')
					if (flow_state_value && flow_state_value === 'finished') {
						_param.editable = false
					} else {
						_param.editable = true
					}
					_moduleConfig.initParam = _param
					sysmanMain.setCurrentModuConfig(_moduleConfig)

					var $grid = $('#' + window_id + " table.dg-list");
					var $edit_window = $('#' + editWindow);
					var _url = '/' + sysmanMain.getRootPath()
							+ '/oa/query/editPage.action';
					var _dgparam = {
						grid : $grid,
						window : $edit_window,
						href : _url,
						width : window_width,
						height : window_height,
						flag : true,
						existCheckElement : 'form'
					}

					_dgparam.onClose = public_method.closeWindow

					datagridServ.windowEdit(_dgparam);
				},
				/**
				 * 初始化条件查询框
				 * 
				 * @param _options.rootid
				 *            窗口根节点id
				 * @param _options.conditionSelector
				 *            条件框节点选择器
				 */
				initCondition : function(_options) {
					if (window.console) {
						console.info('recipel init loaded and starting...')
					}

					flowInit.initList(_options)
				},
				detailInfo : function() {
					if (window.console) {
						console.info('show detail loaded...')
					}

					var _config = {}
					// 查找耗材清单panel
					var innerpanelElement = $('#' + rootid
							+ ' div.inner-table-panel')

					var _inpatientno
					if (innerpanelElement.length > 0) {
						// 判断panel状态
						var isopen = panelUtil.getPanelState({
									target : innerpanelElement
								})
						if (isopen) {
							$(innerpanelElement).panel('close')
						} else {
							$(innerpanelElement).panel('open')
						}
					}

				},
				/**
				 * 更新质询子类信息
				 * 
				 * @param _options.form
				 * @param _options.record
				 * @param _options.target
				 */
				changeSubItem : function(_options) {
					var _subSelect = $(_options.form)
							.find('#inquiry_item_subcode')
					$(_subSelect).combobox({
						textField : 'name',
						valueField : 'id',
						readonly : false,
						url : _rootpath + '/dictionary/getTree.action?id='
								+ _options.record.id,
						onSelect : function(record) {
							var _item = $(_options.form)
									.find('#inquiry_item_sub')
							$(_item).val(record.text)
						}
					})
				},

				reCreateField : function(_options) {

					var normal_width_param = {
						width : el_width
					}
					var big_width_param = $.extend({}, {
								width : el_big_width,
								multiline : true,
								height : 50
							})
					var $form = _options.form
					_rootpath = '/' + sysmanMain.getRootPath()
					var fConfig = {
						name : $.extend({
									fieldType : 'textbox'
								}, normal_width_param),
						/*apply_deptname : $.extend({
									fieldType : 'textbox',
									onClickButton : function(data) {
										deptSelect.openPage({
													deptid : window_id
															+ ' #apply_deptid',
													deptname : window_id
															+ ' #apply_deptname'
												})
									}
								}, normal_width_param),*/
						apply_deptname : $.extend({
									fieldType : 'textbox'
								}, normal_width_param),	
						apply_date : $.extend({
									fieldType : 'datebox'
								}, normal_width_param),
						apply_content : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						biz_content : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						party_committee_approve : $.extend({
									fieldType : 'textbox'
								}, normal_width_param),
						view_collection : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						directLeader_content : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						chargeLeader_content : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						approve_info : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						meeting_approve : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						buying_division_call_for_bids : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						buying_division_purchasing : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						add_file : $.extend({
									fieldType : 'textbox'
								}, big_width_param),
						apply_name : $.extend({
							fieldType : 'textbox',
							onClickButton : function(data) {
								deptUserSelect.openPage({
									userids : 'oa-tempdrugpurchase-win #apply_id',
									usernames : 'oa-tempdrugpurchase-win #apply_name',
									deptid : 'oa-tempdrugpurchase-win #apply_deptid',
									deptname : 'oa-tempdrugpurchase-win #apply_deptname'
								})
							}
						}, normal_width_param)

					}
					flowInit.initField({
								fieldConfig : fConfig,
								fieldStatus : _options.data,
								window_id : window_id
							})
							
							
							
							
							
							
					var param={
				     	window_id:window_id,
				     	user_id:'apply_id',
				     	user_name:'apply_name',
				     	user_deptid:'apply_deptid',
				     	user_deptname:'apply_deptname'
				     }
				     
				     deptUserSelect.initUser(param)
					$.messager.progress('close')
				}

				/*
				 * reCreateField:function(_options){ if(window.console){
				 * console.info(' recipel reCreateField loaded and startting
				 * ...') } var data = _options.data var $form = _options.form
				 * _rootpath = '/'+sysmanMain.getRootPath()
				 * 
				 * var normal_param = {required:true,editable:true} var
				 * normal_width_param =
				 * $.extend({},normal_param,{width:el_width}) var
				 * big_width_param =
				 * $.extend({},normal_param,{width:el_big_width,multiline:true,height:50})
				 * var deptQueryUrl='/department/query/getTreeList.action' var
				 * selectedRecord = $('#'+ rootid+ '
				 * table.dg-list').datagrid('getSelected') var fields =
				 * data.editFilter.enabled.split(',') if(fields &&
				 * (fields.length>0)){
				 * 
				 * for(var i =0;i<fields.length;i++){ var _el
				 * =$($form).find('#' + fields[i]) switch(fields[i]){ case
				 * 'bizno': $(_el).textbox(normal_width_param) break; case
				 * 'inquiry_date':
				 * $(_el).datebox($.extend({readonly:false},normal_width_param))
				 * if(selectedRecord && selectedRecord.inquiry_date){
				 * $(_el).datebox('setValue',selectedRecord.inquiry_date) }
				 * break; case 'inquiry_reason': $(_el).textbox(big_width_param)
				 * break; case 'litigant_content':
				 * $(_el).textbox(big_width_param) break; case 'decide_content':
				 * $(_el).textbox(big_width_param) break;
				 * 
				 * case 'affirm_content': $(_el).textbox(big_width_param) break;
				 * case 'patient_id': $(_el).textbox({ width:el_width,
				 * required:true, readonly:false, onClickButton:function(data){
				 * var $dept_window = $('#win-dept-patient');
				 * 
				 * $($dept_window).attr('callback-id','medical-recipel-win
				 * #bizid')
				 * $($dept_window).attr('callback-patient_id','medical-recipel-win
				 * #patient_id')
				 * $($dept_window).attr('callback-doct_name','medical-recipel-win
				 * #doct_name')
				 * $($dept_window).attr('callback-doct_id','medical-recipel-win
				 * #doct_id')
				 * $($dept_window).attr('callback-doct_depart_name','medical-recipel-win
				 * #doct_depart_name')
				 * $($dept_window).attr('callback-doct_depart_code','medical-recipel-win
				 * #doct_depart_code')
				 * $($dept_window).attr('callback-patient_name','medical-recipel-win
				 * #patient_name') sysmanMain.deptPatientSelect()} }) break;
				 * case 'inquiry_item_code': var _mainSelect =
				 * $(_options.form).find('#inquiry_item_code')
				 * $(_mainSelect).combobox({ width:el_width, required:true,
				 * readonly:false, textField:'name', valueField:'id',
				 * url:_rootpath + '/dictionary/getTree.action?id=' + 4,
				 * onSelect:function(record){ var _item =
				 * $(_options.form).find('#inquiry_item')
				 * $(_item).val(record.text)
				 * private_method.changeSubItem({form:_options.form,record:record}) },
				 * onLoadSuccess:function(){ if(selectedRecord &&
				 * selectedRecord.inquiry_item_code){
				 * $(_mainSelect).combobox('select',selectedRecord.inquiry_item_code)
				 * private_method.changeSubItem({form:_options.form,record:{id:selectedRecord.inquiry_item_code}}) } } })
				 * 
				 * break; case 'decide_result_code': //裁决意见 var _decideSelect =
				 * $(_options.form).find('#decide_result_code')
				 * $(_decideSelect).combobox({ width:el_width, required:true,
				 * readonly:false, textField:'name', valueField:'id',
				 * url:_rootpath + '/dictionary/getTree.action?id=' + 106,
				 * onSelect:function(record){ var _item =
				 * $(_options.form).find('#decide_result')
				 * $(_item).val(record.name)
				 * 
				 * var $username = $(_options.form).find('#decide_name') var
				 * $userid = $(_options.form).find('#decide_id')
				 * 
				 * var curUser = sysmanMain.getCurrentUser()
				 * $($username).textbox('setValue',curUser.name)
				 * $($userid).val(curUser.id) }, onLoadSuccess:function(){
				 * if(selectedRecord && selectedRecord.decide_result_code){
				 * $(_decideSelect).combobox('select',selectedRecord.decide_result_code) } } })
				 * 
				 * break; case 'affirm_result_code': //认定意见 var _confirmSelect =
				 * $(_options.form).find('#affirm_result_code')
				 * $(_confirmSelect).combobox({ width:el_width, required:true,
				 * readonly:false, textField:'name', valueField:'id',
				 * url:_rootpath + '/dictionary/getTree.action?id=' + 112,
				 * onSelect:function(record){ var _item =
				 * $(_options.form).find('#affirm_result')
				 * $(_item).val(record.name)
				 * 
				 * var $username = $(_options.form).find('#affirm_name') var
				 * $userid = $(_options.form).find('#affirm_id')
				 * 
				 * var curUser = sysmanMain.getCurrentUser()
				 * $($username).textbox('setValue',curUser.name)
				 * $($userid).val(curUser.id) }, onLoadSuccess:function(){
				 * if(selectedRecord && selectedRecord.affirm_result_code){
				 * $(_confirmSelect).combobox('select',selectedRecord.affirm_result_code) } } })
				 * 
				 * break; }
				 * 
				 *  } // $($form).form('enableValidation').form('validate') }
				 *  }
				 */

			}

			return public_method;

		})
